<html lang="zh-CN">
<head>
<title>验证码</title>
<meta charset="UTF-8">
<meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">

<link href="{$Think.config.RESOURCEURL}wx_assets/css/product_list.css" rel="stylesheet">
<link href="{$Think.config.RESOURCEURL}wx_assets/css/product_templates.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/css/card.css?v=20131217" media="all" />

<link rel="stylesheet" href="{$Think.config.RESOURCEURL}wx_assets/css/employee_manage.css?_vr_=1389175823610" />
    <!-- ▲Common CSS -->
    
    <!-- ▼_global -->
    <script type="text/javascript">
    var _global = {"kdt_id":"2","user_id":0,"run_mode":"online","debug":false,"project":"default","online_debug":true,"js":{"js_compress":true,"message_report":true,"checkbrowser":true,"hide_wx_nav":true},"query_path":"\/showcase\/feature","module":"showcase","controller":"Showcase_Feature_Controller","action":"index","full_action":"getIndexHtml","method":"get","format":"html","page_size":760,"is_mobile":false,"isShopDomain":true,"mp_changed":false,"is_owner_team":false,"fans_id":0,"is_fans":2,"mp_id":"2","mp_data":{"mp_id":"2","kdt_id":"2","mp_weixin":"kdtnote","mp_nickname":"\u53e3\u888b\u901a\u6d88\u606f","mp_picture":"http:\/\/static.koudaitong.com\/assets\/img\/avatar\/2.jpg","is_display_footbar":"1"},"ajaxURL":{"isFans":"http:\/\/koudaitong.com\/v1\/api\/fans\/check?fans_mi=2"},"logURL":"http:\/\/tj.koudaitong.com\/1.gif","from_weibo":0,"url":{"base":"http:\/\/koudaitong.com","domain":"koudaitong.com","cp":"http:\/\/cp.koudaitong.com","pay":"http:\/\/pay.koudaitong.com","trade":"http:\/\/trade.koudaitong.com","api":"http:\/\/api.koudaitong.com","img":"http:\/\/img.koudaitong.com","static":"http:\/\/static.koudaitong.com\/v2","www":"http:\/\/koudaitong.com\/v2","v1":"http:\/\/koudaitong.com\/v1","short_url":"http:\/\/koudaitong.com","v1_static":"http:\/\/static.koudaitong.com\/v1","wap":"http:\/\/wap.koudaitong.com\/v2","imgqn":"http:\/\/imgqn.koudaitong.com","goods_search":"http:\/\/10.6.5.28:8899","callback_queue":"http:\/\/10.6.5.28:8899\/queue","log_url":"http:\/\/tj.koudaitong.com\/1.gif","cron":"http:\/\/10.6.5.28:1934\/","taobao_item":"http:\/\/item.taobao.com","scv":"http:\/\/scv.koudaitong.com","qrcode":"http:\/\/10.6.5.28:8080\/qr?","taobao_wap_item":"http:\/\/a.m.taobao.com"}};    _global.spm = {logType:"f",logId:"1012536"};
    </script>
    <!-- ▼Global & Libs -->
    <script type="text/javascript">
    (function(ua) {
        var ele = document.documentElement;
        if (ua.match(/micromessenger\/5/gi)) {
            ele.className = ele.className + ' mobile wx_mobile wx_mobile_5';
        } else if (ua.match(/micromessenger/gi)) {
            ele.className = ele.className + ' mobile wx_mobile';
        } else if (window._global.is_mobile) {
            ele.className = ele.className + ' mobile'
        }
    })(navigator.userAgent || navigator.vendor || window.opera)
    </script>
    <!-- ▲_global -->

<script type="text/javascript" src="wx_assets/js/share_product.js?2014-01-05"></script>
<script src="wx_assets/js/zepto_product.js?v=201401121"></script> 
<script type="text/javascript" src="wx_assets/js/alert.js"></script>

<script src="wx_assets/js/jquery-2.0.3.min.js"></script>
<script src="wx_assets/js/idangerous.swiper-2.4.1.min.js"></script>
<script src="wx_assets/js/wap.min.js?v=1389175823610"></script>


</head>
<body>

	<div class="lay_page page_icenter" id="page_icenter">
		<div class="lay_page_wrap">
			<div id="itemList">
				<div id="normalList">
					<a href="javascript:void(0)">
						<div class="mod_cell qb_mb15">
							<div class="mod_celltitle">
				                <h3 class="qb_fl">验证码信息</h3>
				            </div>
							<div class="mod_slider">
								<div class="slider_cnt">
									<ul>
										<div class="bfc_c" style="padding:10px;line-height:23px;">
							                <p>验证码：{$code}</p>
							                <p>对应奖励：{$reward}</p>
							                <p>使用状态：
							                <if condition="$isClaim eq 1">[已经使用]
							                <p>使用时间：{$claimTime}</p>
							                <else />[暂未使用]
							                </if>
							                </p>
							                <p>可用状态：
							                <if condition="$disabled eq 1">
							                	[可用]
							                <else />
							                	[不可用]
							                </if>
							                </p>
										</div>
									
									</ul>
								</div>
							</div>
						</div>
					</a>
					
				</div>
			</div>
			
		</div>
	</div>
	
	<if condition="$isClaim eq 0">
		<div class="cardexplain">
			<div class="footReturn">
				<input type="button" id="showcard" class="submit" value="使    用" />
				<div class="window" id="windowcenter">
					<div id="title" class="wtitle">
						使用<span class="close" id="alertclose"></span>
					</div>
					<div class="content">
						<div id="txt"></div>
					</div>
				</div>
			</div>
		</div>
	</if>
	
	<div class="bottomcontent js-mini-height">
	<div class="shopnav js-navmenu nav-on-bottom style-2">
        <div class="nav-menu has-menu-2">
			<div class="one">
            	<a class="mainmenu js-mainmenu" onclick="searchSystem('verifyCode')" >
					<i class="arrow-weixin"></i>
                    	验证码
            	</a>
            </div>
            
            <div class="divide">&nbsp;</div>
        
                
            <div class="one">
           		<a class="mainmenu js-mainmenu" onclick="searchSystem('order')">
                   	<i class="arrow-weixin"></i>
                               	订单
                </a>
                 
            </div>

            </div>
		</div>            
	</div>
	
	<div class="qb_quick_tip qb_none" id="bubble"></div>

<script>
var hrefParamsArray = GetSessionIdFromHref(window.location.search);

function GetSessionIdFromHref(search){
　　	var args = search.substring(1); 
　　	var retval = new Array(); 
	args = args.split("&"); 
		for(var i = 0; i < args.length; i ++){ 
			str = args[i]; 
			var arg = str.split("="); 
			if(arg.length <= 1) continue; 
			
			if(arg[0] == 'params') {
				var params = decodeURIComponent(arg[1]);
				var obj = eval('(' + params + ')');
				if (obj.euid != undefined) {
					retval["euid"] = obj.euid;
				}
				if (obj.euname != undefined) {
					retval["euname"] = obj.euname;
				}
			} else if(arg[0] == 'customerId') {
				retval["customerId"] = arg[1]; 
			}else if(arg[0] == 'userName'){
				retval["userName"] = arg[1]; 
			}
		} 
		if (retval["start"] == undefined) {
			retval["start"] = 0;
		}
		return retval; 
}

function onDetail(id) {
	var rootid = '';
	if (hrefParamsArray["rootid"] !== undefined) {
		rootid = ',"rootid":' + hrefParamsArray["rootid"];
	}
	window.location.href = 'call.html?userName={$userName}&customerId={$customerId}&module=product&method=getOrderDetail&params={"tplid":1,"id":"' + id + '"'
		+ rootid + '}';
}
</script>
<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto_product.js?v=201401121"></script>
<script type="text/javascript">

$(document).ready(function () {
    $("#showcard").click(function () {
    	
    	var baseUrl =  '{$Think.config.SERVER_HOST}';
    	var urlString = baseUrl + 'call.json?customerId={$customerId}';
    	var code ='{$code}';
       	if(code == '') {
       		alert('当前验证码不满足使用条件');
    		return;
       	}
       	
       	$("#showcard").val("提交中...");
		$("#showcard").attr("disabled", true);
		var euid = hrefParamsArray["euid"];
		var euname = hrefParamsArray["euname"];
		var type = hrefParamsArray["type"];
		
		/*
		window.location.href = 'call.html?userName=' + hrefParamsArray['userName'] + '&customerId='
		+ hrefParamsArray['customerId'] + '&module=employeeManage&method=claimVerifyCode&params={"euid":"' + euid + '","euname":"' + euname +'","code":"' + code + '"}';
*/
    	$.ajax({url : urlString,
    				dataType : "json",
    				type : "post",
    				timeout:15000,
    				data : {
    					'module': 'employeeManage',
    			        'method' : 'claimVerifyCode',
    			        'params' : '{"euid":"' + euid + '","euname":"' + euname +  '","code":"' + code + '"}',
    				},
    				success : function(data) {
    					if (data.code != undefined && data.code != 0 ) {
    						alert(data.msg);
    						$("#showcard").val("使    用");
    						return;
    					}else{
    						alert("使用成功");
    						$("#showcard").val("使用成功");
    						$("#showcard").attr("disabled", true);
    						window.setTimeout("goBack()",1000);
    					}
    					/*
    					window.location.href = 'call.html?userName=' + hrefParamsArray['userName'] + '&customerId='
    						+ hrefParamsArray['customerId'] + '&module=employeeManage&method=get&params={"cid":'+  cid +'}';
    					*/
    				},
    				error: function(jqXHR, textStatus, errorThrown){
    					alert('发送超时,可能存在网络异常,检查后请重试...');
 						$("#showcard").val("使    用");
 						$("#showcard").attr("disabled", false);
 						
    			     }
    		});
    	
    });
});

function goBack(){
	window.history.go(-1);
}

function searchSystem(type) {
	
	var euid = hrefParamsArray['euid'] ;
	var euname = hrefParamsArray['euname'] ;
	window.location.href = 'call.html?customerId={$customerId}&module=employeeManage&method=searchSystem'
		+ '&params={"euid":' + euid +',"euname":"'+ euname + '","type":"'+type+'"}';
}

</script>
</body>
</html>